package com.pro.system.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.pro.system.auto.entity.Role;
import com.pro.system.service.RoleService;

@Controller
@RequestMapping("/role")
public class AdminRoleController {
	
	@Autowired
	private RoleService roleService;
	
	/***
	 * 跳转到用户设置角色
	 * @return
	 */
	@RequestMapping(value ="/settingRole",method={RequestMethod.GET})
	public ModelAndView settingRole(Integer userId){
		
		List<Role> roleList = this.roleService.findAllRoles();
		ModelAndView modelAndView = new ModelAndView("admin/user/authorizeUser");
		modelAndView.addObject("role", roleList);
		modelAndView.addObject("userId", userId);
		return modelAndView;
	}
}
